home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Source Code / Libraries / LinAlg 3.1 / LinAlg / vali.dat < prev    next >
Text File  |  1995-12-21  |  4KB  |  126 lines

  1.  
  2.  
  3.         Verification of the Aitken-Lagrange interpolation
  4.  
  5. ------------- Interpolation over the table with uniform grid
  6. Function to interpolate: exp(-x)
  7.  
  8. Check to see that interpolation at a node gives an exact result
  9.  
  10. Uniform grid [0.1:1] with the step 0.1
  11.  
  12. Done
  13.  
  14. Check the precision of the interpolation at arbitrary points
  15.  
  16. Uniform grid [0.1:1] with the step 0.1
  17.  
  18. Point   Exact function value     Interpolated    Error
  19.    0               1            0.999998   1.72853e-06
  20. 0.11        0.895834            0.895834   1.26336e-08
  21. 0.22        0.802519            0.802519   1.29626e-08
  22. 0.33        0.718924            0.718924   1.41076e-08
  23. 0.44        0.644036            0.644036   8.84407e-09
  24. 0.55         0.57695             0.57695   1.43652e-07
  25. 0.66        0.516851            0.516851   3.10746e-08
  26. 0.77        0.463013            0.463013   1.53709e-08
  27. 0.88        0.414783            0.414783   8.92645e-08
  28. 0.99        0.371577            0.371576   4.41423e-07
  29.  1.1        0.332871            0.332871   2.12869e-07
  30.  
  31. Done
  32.  
  33. ------------- Interpolation over the table with non-uniform grid
  34. Function to interpolate: sin(x) * exp(-x/10)
  35.  
  36. Grids 0.1 .. 1 have the mesh 0.1, and 1..9 have the mesh 0.2
  37.  
  38. Check to see that interpolation at a node gives an exact result
  39.  
  40. Done
  41.  
  42. Check the precision of the interpolation at arbitrary points
  43.  
  44. Point   Exact function value     Interpolated    Error
  45.    0               0         8.51708e-07   8.51708e-07
  46. 0.27        0.259626            0.259626   1.14471e-08
  47. 0.54        0.487109            0.487109   3.00486e-08
  48. 0.81        0.667933            0.667933   1.61806e-08
  49.  1.1         0.79167             0.79167   6.00246e-08
  50.  1.4        0.852505            0.852481   2.41944e-05
  51.  1.6        0.849412            0.849412    1.1897e-08
  52.  1.9        0.785971            0.785972   1.42046e-07
  53.  2.2        0.669875            0.669875   9.72032e-08
  54.  2.4        0.512161            0.512161   3.90728e-09
  55.  2.7        0.326253            0.326253   1.96635e-08
  56.    3        0.126876            0.126876   2.32042e-08
  57.  3.2      -0.0710583          -0.0710583    2.1131e-08
  58.  3.5       -0.253526           -0.253526   2.44474e-08
  59.  3.8       -0.408341            -0.40834   1.73721e-07
  60.  
  61. Done
  62.  
  63. Check the precision of the interpolation at arbitrary points
  64.  
  65. Example from Fig. 4.11 of the book
  66.     Numerical Methods and Software,
  67.     by D.Kahaner, C.Moler, and S.Nash - Prentice Hall, 1989
  68.  
  69.         Interpolation nots
  70. x      0      2      3      5      6      8      9     11     12     14     15 
  71. y     10     10     10     10     10     10     10     15     50     60     85 
  72.  
  73. Point   Interpolated value
  74.       0             10
  75.    0.32             10
  76.    0.64             10
  77.    0.96             10
  78.    1.28             10
  79.     1.6             10
  80.    1.92             10
  81.    2.24             10
  82.    2.56             10
  83.    2.88             10
  84.     3.2             10
  85.    3.52             10
  86.    3.84             10
  87.    4.16             10
  88.    4.48             10
  89.     4.8             10
  90.    5.12             10
  91.    5.44             10
  92.    5.76             10
  93.    6.08             10
  94.     6.4             10
  95.    6.72             10
  96.    7.04        9.94286
  97.    7.36        9.93781
  98.    7.68        9.95318
  99.       8             10
  100.    8.32        10.0911
  101.    8.64        10.2309
  102.    8.96        10.4641
  103.    9.28        10.2771
  104.     9.6          9.232
  105.    9.92        8.71549
  106.   10.24        5.79377
  107.   10.56        9.07021
  108.   10.88        12.9199
  109.    11.2        20.6143
  110.   11.52         29.442
  111.   11.84        42.5424
  112.   12.16        57.7971
  113.   12.48        73.2555
  114.    12.8        86.0592
  115.   13.12        62.2166
  116.   13.44        61.3373
  117.   13.76        60.1782
  118.   14.08        60.8715
  119.    14.4             66
  120.   14.72        74.3712
  121.   15.04        86.8043
  122.   15.36        104.118
  123.   15.68        127.133
  124.  
  125. Done
  126.